<?php

namespace App\models;

use App\User;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
//    通过订单编号找订单明细
   public function orderDetails()
   {
       return $this->hasMany(OrderDetail::class,'order_id','id');
   }
   public function address()
   {
       return $this->hasOne(Address::class,'id','address_id');
   }
   public function user()
   {
       return $this->hasOne(User::class,'id','user_id');
   }
}
